package iterators;
import list.*;

public class ListIterator implements Iterator
{
    List list;
    Element current;
    
    public ListIterator (List _list)
    {
            list = _list;
            current = null;
    }
    
    public Object CurrentItem()
    {
            return current.getData();
    }
    
    public void First()
    {
            current = list.getFirst();
    }
    
    public boolean IsDone()
    {
            if(current==null)
                    return false;
            return true;
    }
    
    public void Next()
    {
            if(current != null)
                    current = current.getNext();
    }
	

}
